package com.csgc.camera.storage

import com.csgc.camera.storage.base.BasePreferences
import com.hjq.permissions.Permission


class PermissionRequestPreference private constructor(preferenceID:String): BasePreferences(preferenceID ) {

    companion object{


        val instance by lazy(LazyThreadSafetyMode.NONE){
            PermissionRequestPreference("permission")
        }
    }

    //定位
    fun setLocationCount(count:Int){
        this.setInt(Permission.ACCESS_FINE_LOCATION,count)
    }
    fun getLocationCount():Int{
        return getInt(Permission.ACCESS_FINE_LOCATION,0)?:0
    }

    //相机
    fun setCameraCount(count:Int){
        this.setInt(Permission.ACCESS_FINE_LOCATION,count)
    }
    fun getCameraCount():Int{
        return getInt(Permission.ACCESS_FINE_LOCATION,0)?:0
    }

    //录音
    fun setAudioCount(count:Int){
        this.setInt(Permission.ACCESS_FINE_LOCATION,count)
    }
    fun getAudioCount():Int{
        return getInt(Permission.ACCESS_FINE_LOCATION,0)?:0
    }


    //存储
    fun getStorage():Int{
        return getInt(Permission.WRITE_EXTERNAL_STORAGE,0)?:0
    }
    fun setStorage(count:Int){
        this.setInt(Permission.WRITE_EXTERNAL_STORAGE,count)
    }


    //相册图片
    fun getAlbumRequestCount():Int{
        return getInt(Permission.READ_MEDIA_IMAGES,0)?:0
    }
    fun setAlbumRequestCount(count:Int){
        this.setInt(Permission.READ_MEDIA_IMAGES,count)
    }
}